package main

import (
	"context"
	"github.com/micro/go-micro/v2"
	"log"
	"mygo_micro/Users"
)

type UserService struct {
}

func (u *UserService) Test(ctx context.Context, req *mygo_micro.UserRequest, rsp *mygo_micro.UserResponse) error {
	rsp.Name = "users"
	return nil
}
func NewUserServices() *UserService {
	return &UserService{}
}
func main() {
	service := micro.NewService(
		micro.Name("ceshi_server"))
	service.Init()

	err := mygo_micro.RegisterUserServiceHandler(service.Server(), NewUserServices())
	if err != nil {
		log.Fatal(err)
	}
	if err = service.Run(); err != nil {
		log.Println(err)
	}
}
